<template>
    <div>
        <div class="tabitem" @click="hanleClick()">
            <div>
                <i :class="['iconfont',item.icon]"></i>
            </div>
            <div>{{item.text}}</div>
        </div>
    </div>
</template>

<script>
export default {
    props:{
        item:{
            type:Object
        },
        index:{
            type:Number
        }
    },
    methods:{
        hanleClick(){
            console.log('*************',this.index);
            this.$emit('getIndex',this.index)
        }
    }
}
</script>

<style lang="scss">
@import url('@/assets/css/base.css');
.tabitem{
    flex: 1;
    .iconfont{
        font-size: 24px;
    }
}
</style>